* ======================================================================================
* Replication Do-File for "Lobbyists for Hire: Collaboration between Interest Groups 
* and Political Consultancies in the European Union"
* by Oliver Huwyler, 20/08/2018
* ======================================================================================



*************************
*** Data for Figure 1 ***
*************************

* For inside lobbying:
tab MonitoringProp if StrategyBought2!= . & OrgType < 7
tab LobbyingAdviceProp if StrategyBought2!= . & OrgType < 7
tab LegalAdviceProp if StrategyBought2!= . & OrgType < 7
tab MakeContactProp if StrategyBought2!= . & OrgType < 7
tab ComSupportProp if StrategyBought2!= . & OrgType < 7
tab DirectContactProp if StrategyBought2!= . & OrgType < 7

* For outside lobbying:
tab MobiliseProp if StrategyBought2!= . & OrgType < 7
tab PressProp if StrategyBought2!= . & OrgType < 7
tab EventsProp if StrategyBought2!= . & OrgType < 7


***************
*** Table 2 ***
***************
tab StrategyBought2 if OrgType < 7


***************
*** Table 3 ***
***************
* Dependent variables
sum ConsultCollabProp if OrgType < 7
sum InsideVsNone if OrgType < 7
sum InsideOutsideVsInside if OrgType < 7

* Independent variables
sum OrgTypeBinary if OrgType < 7
sum EUStaff if OrgType < 7
sum BrussOffice if OrgType < 7
sum UmbrellaOrg2 if OrgType < 7
sum LobbyingSpend if OrgType < 7
sum lgNumProposalSpend if OrgType < 7

* Controls
sum lgRepresent if OrgType < 7
sum EUMSActivity if OrgType < 7

*****************************
*** Multivariate Analysis ***
*****************************


***************
*** Table 4 ***
***************

* Any collaboration:

logit ConsultCollabProp OrgTypeBinary lgRepresent EUMSActivity, vce(cluster Proposal) or // Model 1
logit ConsultCollabProp OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice UmbrellaOrg2, vce(cluster Proposal) or // Model 2
logit ConsultCollabProp OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice LobbyingSpend lgNumProposalSpend UmbrellaOrg2, vce(cluster Proposal) or // Model 3



***************
*** Table 5 ***
***************

* Inside Services:

logit InsideVsNone OrgTypeBinary lgRepresent EUMSActivity, vce(cluster Proposal) or // Model 4
logit InsideVsNone OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice UmbrellaOrg2, vce(cluster Proposal) or // Model 5
logit InsideVsNone OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice LobbyingSpend lgNumProposalSpend UmbrellaOrg2, vce(cluster Proposal) or // Model 6


* Outside Services:

logit InsideOutsideVsInside OrgTypeBinary lgRepresent EUMSActivity, vce(cluster Proposal) or // Model 4
logit InsideOutsideVsInside OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice UmbrellaOrg2, vce(cluster Proposal) or // Model 5
logit InsideOutsideVsInside OrgTypeBinary lgRepresent EUMSActivity EUStaff BrussOffice LobbyingSpend lgNumProposalSpend UmbrellaOrg2, vce(cluster Proposal) or // Model 6




* ======================================================================================
* Online Appendix
* ======================================================================================


******************************************************************************
*** PCA with a tetrachoric correlation matrix - Proposal Specific Services ***
******************************************************************************

// If the model includes variables that are dichotomous or ordinal a factor analysis can be 
// performed using a tetrachoric correlation matrix. In Stata a matrix of 
// tetrachoric correlations is created by using the user-written command tetrachoric.


global xlist MonitoringProp LobbyingAdviceProp LegalAdviceProp MakeContactProp ComSupportProp DirectContactProp MobiliseProp PressProp EventsProp

// Important note: BrussOff_Consult has to be omitted. It only occurs once in the entire data set...

global id RespondentID
global ncomp 2 // Number of components you want to retain. This number should be a bit tampered with...

summarize $xlist

*** Use the tetrachoric 
tetrachoric $xlist, posdef

matrix rho = r(Rho) // Store the tetrachoric correlation matrix

matrix symeigen eigenvectors eigenvalues = rho

matrix list eigenvalues

pcamat rho, n(320) factors(2) // n(...) "option" gives the sample size


* Principal component analysis
pcamat rho, n(320) comp($ncomp) blanks(.3)

* Component rotations
rotate, varimax
rotate, varimax blanks(.3)
rotate, clear










